package avicit.bdp.dms.prm.utils.enums;

import avicit.bdp.core.enums.BaseEnum;

/**
 * @金航数码科技有限责任公司
 * @作者：liyb
 * @邮箱：liyb@avic-digital.com
 * @创建时间： 2021-04-29 15:25
 * @类说明：
 * @修改记录：
 */
public enum PythonResStatus implements BaseEnum {

    // 状态 0-未安装 1-已安装
    UNINSTALLED(0, "未安装"),
    INSTALLED(1, "已安装");

    private final int code;
    private final String description;

    PythonResStatus(int code, String description){
        this.code = code;
        this.description = description;
    }

    @Override
    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static String getDescByCode(Integer code) {
        if (code != null) {
            PythonResStatus[] values = PythonResStatus.values();
            for (PythonResStatus pythonResStatus : values) {
                if (pythonResStatus.getCode() == code) {
                    return pythonResStatus.getDescription();
                }
            }
        }
        return null;
    }

}
